<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>教学记载与评价系统
  </title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="icon" type="image/x-icon" href="imgs/favicon.png">
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <link rel="stylesheet" href="css/font-awesome.min.css">
  <link rel="stylesheet" href="css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="css/all-skins.min.css">
  <link rel="stylesheet" href="css/main.css">
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
  <style>
    .login-logo{
        display: flex;
        flex-direction: column;
    }
    .login-logo span{
        font-size: 30px!important;
        font-weight: bold;
        font-family: '微软雅黑'
    }
    .form-control{
        font-size: 13px!important;
    }
    .login-min{
      width: 100%;
      height: 100%;
      min-width: 1200px;
      position: fixed;
      left: 0;
      top: 0
    }
    .login-container-title{
      font-size: 18px;
      color: white;
      font-family: '微软雅黑';
      text-align: center;
    }
    .login-title{
       font-size: 22px;
       color: rgba(255,255,255,0.8);
       font-family: '微软雅黑';
       text-align: center;
    }
    input.inputStyle::-webkit-input-placeholder{
        color: #c3c3c3
    }
    input.inputStyle:-moz-placeholder{
        color: #c3c3c3
    }
    input.inputStyle:-ms-input-placeholder {
        color: #c3c3c3
    }
    .btn-color{
        background-color: #3997ee;
        color: white;
        width: 100%
    }
    .btn-color:hover{
        background-color: #2787e1;
        color: white
    }
    .refreshImg{
        color: #2787e1;
        font-size: 14px;
    }
    .refreshImg:hover{
        color: #1679d6;
    }
    /*input.inputStyle[placeholder]{
        color: red!
    }*/
  </style>
</head>
<body class="" style="width: 100%;overflow: hidden;">
<div style="" class="login-page login-min">

          <div class="" id="rrapp" v-cloak style="width: 320px;height: 480px;margin:60px auto">
            <div class="login-logo">
              
                <span></span>
                  
                <span class="login-title" style="font-size: 22px">教学记载与评价系统</span>
            </div>
            <!-- /.login-logo -->
                    <div class="login-box-body" style="background-color: rgba(255,255,255,0.4);">
                        <p class="login-container-title">登录</p>
                        <div v-if="error" class="alert alert-danger alert-dismissible">
                          <h4 style="margin-bottom: 0px;"><i class="fa fa-exclamation-circle"></i> {{errorMsg}}</h4>
                        </div>
                        <div class="form-group has-feedback">
                          <input type="text" class="form-control inputStyle" v-model="username" placeholder="账号">
                          <span class="glyphicon glyphicon-user form-control-feedback"></span>
                        </div>
                        <div class="form-group has-feedback">
                            <input type="password" class="form-control inputStyle" v-model="password" placeholder="密码">
                            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                        </div>
                        <div class="form-group has-feedback">
                            <input type="text" class="form-control inputStyle" v-model="captcha" @keyup.enter="login" placeholder="验证码">
                            <span class="glyphicon glyphicon-warning-sign form-control-feedback"></span>
                        </div>
                        <div class="form-group has-feedback">
                            <img alt="如果看不清楚，请单击图片刷新！" class="pointer" :src="src" @click="refreshCode">
                            <a href="javascript:;" style="margin-left: 10px" class="refreshImg" @click="refreshCode">点击刷新</a>
                        </div>

                        <div class="row">
                          <!-- <div class="col-xs-8">
                            <div class="checkbox icheck">
                            </div>
                          </div> -->
                          <!-- /.col -->
                          <div class="">
                            <button style="font-size: 13px" type="button" class="btn btn-block btn-flat btn-color" @click="login">登录</button>
                          </div>
                          <!-- /.col -->
                        </div>
                      <!-- /.social-auth-links -->
                    </div>
            <!-- /.login-box-body -->
          </div>
</div>
<!-- /.login-box -->
<script src="libs/jquery.min.js"></script>
<script src="plugins/jqgrid/jquery.jqGrid.min.js"></script>
<script src="libs/vue.min.js"></script>
<script src="libs/bootstrap.min.js"></script>
<script src="libs/app.js"></script>
<script src="js/common.js"></script>
<script src="js/JSLo从ader.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el:'#rrapp',
        data:{
            username: '',
            password: '',
            captcha: '',
            error: false,
            errorMsg: '',
            src: 'captcha.jpg'
        },
        beforeCreate: function(){
            if(self != top){
                top.location.href = self.location.href;
            }
        },
        methods: {
            refreshCode: function(){
                this.src = "captcha.jpg?t=" + $.now();
            },
            login: function () {
                var data = "username="+vm.username+"&password="+vm.password+"&captcha="+vm.captcha;
                $.ajax({
                    type: "POST",
                    url: baseURL + "sys/login",
                    data: data,
                    dataType: "json",
                    success: function(r){
                        if(r.code == 0){//登录成功
                            localStorage.setItem("token", r.token);
                            localStorage.setItem("webSocketPort", "123.206.20.126:8087/sdufe");
                            parent.location.href ='index.html';
                        }else{
                            vm.error = true;
                            vm.errorMsg = r.msg;
                            vm.refreshCode();
                        }
                    }
                });
            }
        }
    });
</script>
</body>

</html>
